package org.icnmasjid.member.model;
// Generated Feb 5, 2008 8:40:40 AM by Hibernate Tools 3.1.0.beta4

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;



/**
 * @struts.form include-all="true" extends="BaseForm"
 * @hibernate.class
 *         table="member_information"
 *
 */

public class MemberInformation extends org.icnmasjid.member.model.BaseObject implements java.io.Serializable {


    // Fields

    private Integer id;
    private int yearOfMembership;
    private Person person;
    private PersonPayment personPayment;


    // Constructors

    /** default constructor */
    public MemberInformation() {
    }

	/** minimal constructor */
    public MemberInformation(int yearOfMembership) {
        this.yearOfMembership = yearOfMembership;
    }



    // Property accessors
    /**
     *      *            @hibernate.id
     *             generator-class="native"
     *             type="java.lang.Integer"
     *             column="id"
     *
     */

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    /**
     *      *            @hibernate.property
     *             column="year_of_membership"
     *             length="10"
     *             not-null="true"
     *
     */

    public int getYearOfMembership() {
        return this.yearOfMembership;
    }

    public void setYearOfMembership(int yearOfMembership) {
        this.yearOfMembership = yearOfMembership;
    }

    /**
    * @hibernate.many-to-one
    * 	column="person_payment_id"
    */
	public PersonPayment getPersonPayment() {
		return personPayment;
	}

	public void setPersonPayment(PersonPayment personPayment) {
		this.personPayment = personPayment;
	}

   /**
    * @hibernate.many-to-one
    * 	column="person_id"
    */
	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	@Override
	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((id == null) ? 0 : id.hashCode());
		result = PRIME * result + ((person == null) ? 0 : person.hashCode());
		result = PRIME * result + ((personPayment == null) ? 0 : personPayment.hashCode());
		result = PRIME * result + yearOfMembership;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final MemberInformation other = (MemberInformation) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (person == null) {
			if (other.person != null)
				return false;
		} else if (!person.equals(other.person))
			return false;
		if (personPayment == null) {
			if (other.personPayment != null)
				return false;
		} else if (!personPayment.equals(other.personPayment))
			return false;
		if (yearOfMembership != other.yearOfMembership)
			return false;
		return true;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("id", this.id).append("yearOfMembership",
						this.yearOfMembership).append("person", this.person)
				.append("personPayment", this.personPayment).toString();
	}

}
